/*
 * $HeadURL: $
 * $Id: $
 * Copyright (c) 2011 by Ericsson, all rights reserved.
 */

package android.views;

import android.app.Activity;
import android.os.Bundle;
import android.test.R;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

/**
 *
 * @author xyonton
 * @version $Revision: $
 */
public class HelloSpinner extends Activity {
    /** Revision of the class */
    public static final String _REV_ID_ = "$Revision: $";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spinner);

        Spinner spinner = (Spinner) findViewById(R.id.spinner);
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.planets_array,
                android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);

        spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
    }

}
